import { IEvent } from '../type/IEvent';
import { BNode } from '../type/BNode';
export class ActionNode extends BNode implements IEvent {
    constructor(public call: (blackboard?: any) => void) {
        super();
    }

    setCall(call: (blackboard?: any) => void) {
        this.call = call;
    }
    onStart(blackboard?: any): void {
        this.call(blackboard);
        this.task.done();
    }
    onCancel(): void {
        this.call = this.voidFn;
    }
    private voidFn() {}
}
